<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>libspotify: Toplist handling</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">libspotify
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.8.0 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#define-members">Defines</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Toplist handling</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr class="memitem:gaa078b44491f976af43e4941fd1dd032c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__toplist.html#gaa078b44491f976af43e4941fd1dd032c">SP_TOPLIST_REGION</a>(a, b)&#160;&#160;&#160;((a) &lt;&lt; 8 | (b))</td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:gafe8e94ae23133105f35c03b9e3836a0a"><td class="memItemLeft" align="right" valign="top">typedef void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__toplist.html#gafe8e94ae23133105f35c03b9e3836a0a">toplistbrowse_complete_cb</a> (<a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *result, void *userdata)</td></tr>
<tr><td colspan="2"><h2><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga220f32522efb2828e4f8ffb949af234a"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__toplist.html#ga220f32522efb2828e4f8ffb949af234a">sp_toplisttype</a> { <br/>
&#160;&#160;<a class="el" href="group__toplist.html#gga220f32522efb2828e4f8ffb949af234aa41523e58badf9e3901beea3f53e5d28e">SP_TOPLIST_TYPE_ARTISTS</a> =  0, 
<br/>
&#160;&#160;<a class="el" href="group__toplist.html#gga220f32522efb2828e4f8ffb949af234aae8002818ef10eb2c75ec2058ce11cf6b">SP_TOPLIST_TYPE_ALBUMS</a> =  1, 
<br/>
&#160;&#160;<a class="el" href="group__toplist.html#gga220f32522efb2828e4f8ffb949af234aa6a85f8384ec77cb9cb5746966b0f0e28">SP_TOPLIST_TYPE_TRACKS</a> =  2
<br/>
 }</td></tr>
<tr class="memitem:ga6fa5cfed2cbb33f2f64542d0b63f6c8d"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__toplist.html#ga6fa5cfed2cbb33f2f64542d0b63f6c8d">sp_toplistregion</a> { <br/>
&#160;&#160;<a class="el" href="group__toplist.html#gga6fa5cfed2cbb33f2f64542d0b63f6c8da9e9136541401041c7d5c37708b7a927f">SP_TOPLIST_REGION_EVERYWHERE</a> =  0, 
<br/>
&#160;&#160;<a class="el" href="group__toplist.html#gga6fa5cfed2cbb33f2f64542d0b63f6c8da6912eff58c71f5c74b78f48af5305375">SP_TOPLIST_REGION_USER</a> =  1
<br/>
 }</td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gac2fe366e0050747438e09cdd22ed0e31"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__toplist.html#gac2fe366e0050747438e09cdd22ed0e31">sp_toplistbrowse_create</a> (<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session, <a class="el" href="group__toplist.html#ga220f32522efb2828e4f8ffb949af234a">sp_toplisttype</a> type, <a class="el" href="group__toplist.html#ga6fa5cfed2cbb33f2f64542d0b63f6c8d">sp_toplistregion</a> region, const char *username, <a class="el" href="group__toplist.html#gafe8e94ae23133105f35c03b9e3836a0a">toplistbrowse_complete_cb</a> *callback, void *userdata)</td></tr>
<tr class="memitem:gaff81156c09d311c4f6a82d28a32d7968"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__toplist.html#gaff81156c09d311c4f6a82d28a32d7968">sp_toplistbrowse_is_loaded</a> (<a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *tlb)</td></tr>
<tr class="memitem:ga9b881929e74d97f64814ae54953ce4d7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__error.html#gafd27986ce4cd9eeaeca8adda83c9eb6b">sp_error</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__toplist.html#ga9b881929e74d97f64814ae54953ce4d7">sp_toplistbrowse_error</a> (<a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *tlb)</td></tr>
<tr class="memitem:ga5b36332f85efe1a64baf5f54edfdb0f6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__toplist.html#ga5b36332f85efe1a64baf5f54edfdb0f6">sp_toplistbrowse_add_ref</a> (<a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *tlb)</td></tr>
<tr class="memitem:ga1783e3c4b65f41cf0bac66b1053f05b4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__toplist.html#ga1783e3c4b65f41cf0bac66b1053f05b4">sp_toplistbrowse_release</a> (<a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *tlb)</td></tr>
<tr class="memitem:gae2f5c09fbbf947834b1b1e73461f1fb3"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__toplist.html#gae2f5c09fbbf947834b1b1e73461f1fb3">sp_toplistbrowse_num_artists</a> (<a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *tlb)</td></tr>
<tr class="memitem:ga504cc45074d40c817dffbcc2906ef57f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#ga31764fbd69618c10be173c6c03d4c1bc">sp_artist</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__toplist.html#ga504cc45074d40c817dffbcc2906ef57f">sp_toplistbrowse_artist</a> (<a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *tlb, int index)</td></tr>
<tr class="memitem:ga69f5e70269c1eb08e1ddb1c77bb8c3e3"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__toplist.html#ga69f5e70269c1eb08e1ddb1c77bb8c3e3">sp_toplistbrowse_num_albums</a> (<a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *tlb)</td></tr>
<tr class="memitem:gaa080ace445d269f56942ac3d7f1f157e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#ga6fd3e5de729c429fef3ff18ece6dcfad">sp_album</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__toplist.html#gaa080ace445d269f56942ac3d7f1f157e">sp_toplistbrowse_album</a> (<a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *tlb, int index)</td></tr>
<tr class="memitem:gaeb0ddfd565474dc7e444aabebbc119b7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__toplist.html#gaeb0ddfd565474dc7e444aabebbc119b7">sp_toplistbrowse_num_tracks</a> (<a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *tlb)</td></tr>
<tr class="memitem:gaf3d00b8bf089134a4f320a8d3d6ab683"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#ga47bbd2262f0c8b5d7147af7d62198e48">sp_track</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__toplist.html#gaf3d00b8bf089134a4f320a8d3d6ab683">sp_toplistbrowse_track</a> (<a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *tlb, int index)</td></tr>
<tr class="memitem:gab9cf87d6b6a8cbd8d36cd6e94a3270ee"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__toplist.html#gab9cf87d6b6a8cbd8d36cd6e94a3270ee">sp_toplistbrowse_backend_request_duration</a> (<a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *tlb)</td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="gaa078b44491f976af43e4941fd1dd032c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="group__toplist.html#gaa078b44491f976af43e4941fd1dd032c">SP_TOPLIST_REGION</a></td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">b&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;((a) &lt;&lt; 8 | (b))</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Convenience macro to create a toplist region. Toplist regions are ISO 3166-1 country codes (in uppercase) encoded in an integer. There are also some reserved codes used to denote non-country regions. See sp_toplistregion</p>
<p>Example: SP_TOPLIST_REGION('S', 'E') for Sweden </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="toplist_8c-example.html#a18">toplist.c</a>.</dd>
</dl>
</div>
</div>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="gafe8e94ae23133105f35c03b9e3836a0a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef void <a class="el" href="group__toplist.html#gafe8e94ae23133105f35c03b9e3836a0a">toplistbrowse_complete_cb</a>(<a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *result, void *userdata)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The type of a callback used in <a class="el" href="group__toplist.html#gac2fe366e0050747438e09cdd22ed0e31">sp_toplistbrowse_create()</a></p>
<p>When the callback is called, the metadata of all tracks belonging to it will have been loaded, so <a class="el" href="group__track.html#ga8b69cf193679c7e00031ae43e61c6a54">sp_track_is_loaded()</a> will return non-zero. The same goes for the similar toplist data.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">result</td><td>The same pointer returned by <a class="el" href="group__toplist.html#gac2fe366e0050747438e09cdd22ed0e31">sp_toplistbrowse_create()</a> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">userdata</td><td>The opaque pointer given to <a class="el" href="group__toplist.html#gac2fe366e0050747438e09cdd22ed0e31">sp_toplistbrowse_create()</a> </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/><h2>Enumeration Type Documentation</h2>
<a class="anchor" id="ga6fa5cfed2cbb33f2f64542d0b63f6c8d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__toplist.html#ga6fa5cfed2cbb33f2f64542d0b63f6c8d">sp_toplistregion</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Special toplist regions </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="gga6fa5cfed2cbb33f2f64542d0b63f6c8da9e9136541401041c7d5c37708b7a927f"></a>SP_TOPLIST_REGION_EVERYWHERE</em>&nbsp;</td><td>
<p>Global toplist. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga6fa5cfed2cbb33f2f64542d0b63f6c8da6912eff58c71f5c74b78f48af5305375"></a>SP_TOPLIST_REGION_USER</em>&nbsp;</td><td>
<p>Toplist for a given user. </p>
</td></tr>
</table>
</dd>
</dl>

</div>
</div>
<a class="anchor" id="ga220f32522efb2828e4f8ffb949af234a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__toplist.html#ga220f32522efb2828e4f8ffb949af234a">sp_toplisttype</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Toplist types </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="gga220f32522efb2828e4f8ffb949af234aa41523e58badf9e3901beea3f53e5d28e"></a>SP_TOPLIST_TYPE_ARTISTS</em>&nbsp;</td><td>
<p>Top artists. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga220f32522efb2828e4f8ffb949af234aae8002818ef10eb2c75ec2058ce11cf6b"></a>SP_TOPLIST_TYPE_ALBUMS</em>&nbsp;</td><td>
<p>Top albums. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga220f32522efb2828e4f8ffb949af234aa6a85f8384ec77cb9cb5746966b0f0e28"></a>SP_TOPLIST_TYPE_TRACKS</em>&nbsp;</td><td>
<p>Top tracks. </p>
</td></tr>
</table>
</dd>
</dl>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga5b36332f85efe1a64baf5f54edfdb0f6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__toplist.html#ga5b36332f85efe1a64baf5f54edfdb0f6">sp_toplistbrowse_add_ref</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *&#160;</td>
          <td class="paramname"><em>tlb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Increase the reference count of an toplist browse result</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">tlb</td><td>The toplist browse result object </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaa080ace445d269f56942ac3d7f1f157e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__types.html#ga6fd3e5de729c429fef3ff18ece6dcfad">sp_album</a>* <a class="el" href="group__toplist.html#gaa080ace445d269f56942ac3d7f1f157e">sp_toplistbrowse_album</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *&#160;</td>
          <td class="paramname"><em>tlb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>index</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Return the album at the given index in the given toplist browse object</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">tlb</td><td>Toplist object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>Index of the wanted album. Should be in the interval [0, <a class="el" href="group__toplist.html#ga69f5e70269c1eb08e1ddb1c77bb8c3e3">sp_toplistbrowse_num_albums()</a> - 1]</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>The album at the given index in the given toplist browse object </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="toplist_8c-example.html#a9">toplist.c</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga504cc45074d40c817dffbcc2906ef57f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__types.html#ga31764fbd69618c10be173c6c03d4c1bc">sp_artist</a>* <a class="el" href="group__toplist.html#ga504cc45074d40c817dffbcc2906ef57f">sp_toplistbrowse_artist</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *&#160;</td>
          <td class="paramname"><em>tlb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>index</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Return the artist at the given index in the given toplist browse object</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">tlb</td><td>Toplist object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>Index of the wanted artist. Should be in the interval [0, <a class="el" href="group__toplist.html#gae2f5c09fbbf947834b1b1e73461f1fb3">sp_toplistbrowse_num_artists()</a> - 1]</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>The artist at the given index in the given toplist browse object </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="toplist_8c-example.html#a7">toplist.c</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="gab9cf87d6b6a8cbd8d36cd6e94a3270ee"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group__toplist.html#gab9cf87d6b6a8cbd8d36cd6e94a3270ee">sp_toplistbrowse_backend_request_duration</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *&#160;</td>
          <td class="paramname"><em>tlb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Return the time (in ms) that was spent waiting for the Spotify backend to serve the request</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">tlb</td><td>Toplist object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>-1 if the request was served from the local cache If the result is not yet loaded the return value is undefined </dd></dl>

</div>
</div>
<a class="anchor" id="gac2fe366e0050747438e09cdd22ed0e31"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a>* <a class="el" href="group__toplist.html#gac2fe366e0050747438e09cdd22ed0e31">sp_toplistbrowse_create</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__toplist.html#ga220f32522efb2828e4f8ffb949af234a">sp_toplisttype</a>&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__toplist.html#ga6fa5cfed2cbb33f2f64542d0b63f6c8d">sp_toplistregion</a>&#160;</td>
          <td class="paramname"><em>region</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>username</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__toplist.html#gafe8e94ae23133105f35c03b9e3836a0a">toplistbrowse_complete_cb</a> *&#160;</td>
          <td class="paramname"><em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>userdata</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Initiate a request for browsing an toplist</p>
<p>The user is responsible for freeing the returned toplist browse using <a class="el" href="group__toplist.html#ga1783e3c4b65f41cf0bac66b1053f05b4">sp_toplistbrowse_release()</a>. This can be done in the callback.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>Session object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">type</td><td>Type of toplist to be browsed. see the sp_toplisttype enum for possible values </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">region</td><td>Region. see sp_toplistregion enum. Country specific regions are coded as two chars in an integer. Sweden would correspond to 'S' &lt;&lt; 8 | 'E' </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">username</td><td>If region is SP_TOPLIST_REGION_USER this specifies which user to get toplists for. NULL means the logged in user. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>Callback to be invoked when browsing has been completed. Pass NULL if you are not interested in this event. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">userdata</td><td>Userdata passed to callback.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>Toplist browse object</dd></dl>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="group__toplist.html#gafe8e94ae23133105f35c03b9e3836a0a">toplistbrowse_complete_cb</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="toplist_8c-example.html#a19">toplist.c</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga9b881929e74d97f64814ae54953ce4d7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__error.html#gafd27986ce4cd9eeaeca8adda83c9eb6b">sp_error</a> <a class="el" href="group__toplist.html#ga9b881929e74d97f64814ae54953ce4d7">sp_toplistbrowse_error</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *&#160;</td>
          <td class="paramname"><em>tlb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Check if browsing returned an error code.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">tlb</td><td>Toplist browse object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>One of the following errors, from <a class="el" href="group__error.html#ga83154178d3a32668658734d2facfa22b">sp_error</a> SP_ERROR_OK SP_ERROR_IS_LOADING SP_ERROR_OTHER_PERMANENT SP_ERROR_OTHER_TRANSIENT </dd></dl>

</div>
</div>
<a class="anchor" id="gaff81156c09d311c4f6a82d28a32d7968"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="group__toplist.html#gaff81156c09d311c4f6a82d28a32d7968">sp_toplistbrowse_is_loaded</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *&#160;</td>
          <td class="paramname"><em>tlb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Check if an toplist browse request is completed</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">tlb</td><td>Toplist browse object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>True if browsing is completed, false if not </dd></dl>

</div>
</div>
<a class="anchor" id="ga69f5e70269c1eb08e1ddb1c77bb8c3e3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group__toplist.html#ga69f5e70269c1eb08e1ddb1c77bb8c3e3">sp_toplistbrowse_num_albums</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *&#160;</td>
          <td class="paramname"><em>tlb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Given an toplist browse object, return number of albums</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">tlb</td><td>Toplist browse object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>Number of albums on toplist </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="toplist_8c-example.html#a8">toplist.c</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="gae2f5c09fbbf947834b1b1e73461f1fb3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group__toplist.html#gae2f5c09fbbf947834b1b1e73461f1fb3">sp_toplistbrowse_num_artists</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *&#160;</td>
          <td class="paramname"><em>tlb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Given an toplist browse object, return number of artists</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">tlb</td><td>Toplist browse object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>Number of artists on toplist </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="toplist_8c-example.html#a6">toplist.c</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="gaeb0ddfd565474dc7e444aabebbc119b7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group__toplist.html#gaeb0ddfd565474dc7e444aabebbc119b7">sp_toplistbrowse_num_tracks</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *&#160;</td>
          <td class="paramname"><em>tlb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Given an toplist browse object, return number of tracks</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">tlb</td><td>Toplist browse object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>Number of tracks on toplist </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="toplist_8c-example.html#a10">toplist.c</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga1783e3c4b65f41cf0bac66b1053f05b4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__toplist.html#ga1783e3c4b65f41cf0bac66b1053f05b4">sp_toplistbrowse_release</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *&#160;</td>
          <td class="paramname"><em>tlb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Decrease the reference count of an toplist browse result</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">tlb</td><td>The toplist browse result object </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="toplist_8c-example.html#a12">toplist.c</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="gaf3d00b8bf089134a4f320a8d3d6ab683"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__types.html#ga47bbd2262f0c8b5d7147af7d62198e48">sp_track</a>* <a class="el" href="group__toplist.html#gaf3d00b8bf089134a4f320a8d3d6ab683">sp_toplistbrowse_track</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#ga723de429cd073bcf5d13fb4e0f466ffd">sp_toplistbrowse</a> *&#160;</td>
          <td class="paramname"><em>tlb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>index</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Return the track at the given index in the given toplist browse object</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">tlb</td><td>Toplist object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>Index of the wanted track. Should be in the interval [0, <a class="el" href="group__toplist.html#gaeb0ddfd565474dc7e444aabebbc119b7">sp_toplistbrowse_num_tracks()</a> - 1]</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>The track at the given index in the given toplist browse object </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="toplist_8c-example.html#a11">toplist.c</a>.</dd>
</dl>
</div>
</div>
</div><!-- contents -->
<hr size="1"><address style="text-align: right;"><small>
Generated on Wed Mar 28 2012 18:24:10.<br>
Copyright &copy; 2006&ndash;2012 Spotify Ltd</small></address>
</body>
</html>
